<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

if (!function_exists('prep_pdf')) {
    function prep_pdf($orientation = 'portrait') {
        $CI = & get_instance();

        $CI->cezpdf->selectFont(base_url() . '/asset/fonts');

        $all = $CI->cezpdf->openObject();
        $CI->cezpdf->saveState();
        $CI->cezpdf->setStrokeColor(0, 0, 0, 1);
        if ($orientation == 'portrait') {
            $CI->cezpdf->ezSetMargins(50, 70, 50, 50);
            $CI->cezpdf->ezStartPageNumbers(800, 28, 8, '', '{PAGENUM}', 1);
            $CI->cezpdf->line(20, 40, 820, 40);
            $CI->cezpdf->addText(50, 32, 8, 'Tanggal Cetak ' . date('d/m/Y h:i:s a'));
            $CI->cezpdf->addText(50, 22, 8, 'Aplikasi Al-itqon - http://aplikasi.alitqon.or.id');
        } else {
            $CI->cezpdf->ezStartPageNumbers(800, 28, 8, '', '{PAGENUM}', 1);
            $CI->cezpdf->line(20, 40, 820, 40);
            $CI->cezpdf->addText(50, 32, 8, 'Tanggal Cetak ' . date('m/d/Y h:i:s a'));
            $CI->cezpdf->addText(50, 22, 8, 'Aplikasi Al-itqon - http://aplikasi.alitqon.or.id');
        }
        $CI->cezpdf->restoreState();
        $CI->cezpdf->closeObject();
        $CI->cezpdf->addObject($all, 'all');
    }

}

/* End of file pdf_helper.php */
/* Location: ./application/helpers/pdf_helper.php */